import request from "@/plugins/axios";

// 分页接口加入展开过滤（改）
export function getFinanceAssetWarehousingPage (params) {
    return request({
        url: "/api/asset/fixed/warehousing/finance/page",
        method: "get",
        params
    });
}

/**
 * 通过id查询定资产入库信息
 */
export function assetStorageInformation (assetFixedWarehousingId) {
    return request({
        url: `/api/asset/fixed/warehousing/already/${assetFixedWarehousingId}`,
        method: "get"
    });
}

/**
 * 获取所有政府登记项目
 */
export function governmentRegistrationProject () {
    return request({
        url: "/api/asset/registration/all",
        method: "get"
    });
}

/**
 * 添加资产登记记录
 * @param formData
 */
export function addFixedWarehousing (formData) {
    return request({
        url: "/api/asset/fixed/warehousing",
        method: "PUT",
        data: formData
    });
}

/**
 * 校验资产名称的唯一性
 * @param path
 */
export function checkAssetName (assetName) {
    return request({
        url: "/api/asset/fixed/warehousing/check-assetName-add/" + assetName,
        method: "get"
    });
}

/**
 * 校验资产编码的唯一性
 * @param path
 */
export function checkAssetCode (assetCode) {
    return request({
        url: "/api/asset/fixed/warehousing/check-assetCode-add/" + assetCode,
        method: "get"
    });
}

/**
 * 校验凭证号的唯一性
 * @param path
 */
export function checkVoucherNo (voucherNo) {
    return request({
        url: "/api/asset/fixed/warehousing/check-voucherNo-add/" + voucherNo,
        method: "get"
    });
}

/**
 * 检查房源是否已经入库
 * @param voucherNo
 */
export function checkRoomId (roomId) {
    return request({
        url: "/api/asset/fixed/warehousing/check-roomId-add/" + roomId,
        method: "get"
    });
}

// // 未入库分页
// export function warehousingPage (keyword, query) {
//     return request({
//         url: "/api/asset/fixed/warehousing/page?keyword=" + keyword,
//         method: "get",
//         params: query
//     });
// }

/**
 * 导出待入库列表
 * @param searchKeyword
 * @param currentPage
 * @param pageSize
 */
export function exportFinanceWarehousing (params) {
    return request({
        url: "/api/asset/fixed/warehousing/finance/export",
        method: "get",
        responseType: "blob",
        params
    });
}
